Sub Drive1_Change () 'User selected new disk drive...tell the dir control Dir1.Path = Drive1.Drive End Sub Sub Dir1_Change () ' User selected a new directory...tell the FileList control FileList.Path = Dir1.Path End Sub Sub Form_Load () FileList.Pattern = "*.BMP" ' Only see BMP files ' ' Setup to be a server with the topic DDE LinkTopic = "DDE" LinkMode = 1 End Sub Sub Form_LinkClose () ' The DDE link closed so disappear End End Sub Sub FileList_DblClick () ' User has specifically selected a new file... ' grab the new BMP and put it in the picture control FNameUpdate End Sub Sub FNameUpdate () ' Either the user or the DDE link updated the filename... ' so update the (hidden) fname control caption with... ' the new name and grab the BMP into the picture FName.Caption = Dir1.Path + "\" + FileList.FileName BMP.Picture = LoadPicture(FName.Caption) End Sub Sub Form_LinkExecute (CmdStr As String, Cancel As Integer) ' The DDE client asked for the next BMP file in the... ' directory. Since that is the only possible command... ' there is no need to check the CmdStr Cancel = 0 ' Tell the client okay ' ' Check to make sure there are files to work with... ' and then move to the next one, wrapping to the... ' beginning of the list when at the end If (FileList.ListCount <> 0) Then If (FileList.ListIndex < FileList.ListCount - 1) Then FileList.ListIndex = FileList.ListIndex + 1 Else FileList.ListIndex = 0 End If FNameUpdate End If End Sub Sub FileList_PathChange () ' User has changed the path for the file list... ' update the index and count and grab a new BMP if there ' is one in the directory If (FileList.ListCount <> 0) Then FileList.ListIndex = 0 FNameUpdate End If End Sub